/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package model;

/**
 *
 * @author Stupi
 */
public class Multiplication {
    
    public int [][] multiplicationMatrix (int [][] firstMatrix, int [][] secondMatrix) {
        int m = firstMatrix.length;
        int p = firstMatrix[0].length;
        int q = secondMatrix[0].length;
         int j;
         int i;
         int brojac;
         int sum = 0;
        int [][] multi = new int[m][q];
        for ( i = 0 ; i <m ; i++ )
         {
            for ( j = 0 ; j < q ; j++ )
            {   
              for ( brojac = 0 ; brojac < p ; brojac++ )
               {
                  sum = sum + firstMatrix[i][brojac]*secondMatrix[brojac][j];
               }
 
               multi[i][j] = sum;
               sum = 0;
           }
         }
        return multi;
        
        
    }
    
}
